﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "IEventArgs.h"

namespace gcmp
{
    class IDocument;
    /// \brief 构件消隐类型
    enum class ElementHiddenEdgeEventType : int32_t
    {
         Model = 0,   ///< 模型层消隐
         View = 1,       ///< 视图层消隐
    };

    /// \brief  构件因消隐导致ModelShape发生改变的事件参数
    ///
    /// 在消隐完成后发送该事件 \see IElementHiddenEdgeEvent
    class GCMP_MODEL_INTERFACE_EXPORT IElementHiddenEdgeEventArgs : public IEventArgs
    {
        DEFINE_CAST_DERIVED(gcmp::IElementHiddenEdgeEventArgs, gcmp::IEventArgs);
    public:
        
        /// \brief 获取构件本次消隐的具体类型
        ///  \return  消隐的具体类型
        virtual ElementHiddenEdgeEventType GetElementHiddenEdgeType() const = 0;

        ///  \brief 获取发生消隐行为的ElementId
        ///
        /// \return ElementId
        virtual ElementId GetElementId() const = 0;

        /// \brief 获得构件所属文档指针
        /// 
        /// \return IDocument* 文档指针
        virtual IDocument* GetDocument() const = 0;

        /// \brief 设置本次事件源
        ///
        /// \param 本次事件源
        virtual void SetEvent(const IEvent* pEvent) = 0;
    };

    /// \brief  所有构件消隐结束时事件参数
    ///
    /// 在消隐完成后发送该事件 \see IAllElementHiddenEdgeFinishEventHandler
    class GCMP_MODEL_INTERFACE_EXPORT IAllElementHiddenEdgeFinishEventArgs : public IEventArgs
    {
        DEFINE_CAST_DERIVED(gcmp::IAllElementHiddenEdgeFinishEventArgs, gcmp::IEventArgs);
    public:
        /// \brief 获得构件所属文档指针
        /// 
        /// \return IDocument* 文档指针
        virtual IDocument* GetDocument() const = 0;

        /// \brief 设置本次事件源
        ///
        /// \param 本次事件源
        virtual void SetEvent(const IEvent* pEvent) = 0;

        ///  \brief 返回消隐的ElementId
        ///
        /// \return 参与消隐的ElementId
        virtual  const std::set<ElementId>& GetElementIDs() const = 0;
    };
}
